from django import template
from django.template.defaultfilters import stringfilter
from django.utils.safestring import mark_safe
from django.utils.html import escape

register = template.Library()

@register.filter
@stringfilter    
def shortendate(value):
    return value.split(',')[0]

@register.filter
@stringfilter    
def mshortendate(value):
    chunk = value.split(',')[0]
    day, term = chunk.split(' ')
    return '%s%s' % (day, term[0].capitalize())

@register.filter
@stringfilter     
def htel(tel):
    return '<a href="tel:61%s">%s</a>' % (tel[1:], tel)
    